<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var arr = [23, 45, 12, 52, 43, 2, 65]
    var max, min
    //  max = Math.max(...arr)
    //min = Math.min(...arr)


    max = Math.max.call(arr, 23, 45, 12, 52, 43, 2, 65)
    max = Math.max.apply(arr, arr)
    console.log(max, min);
  </script>
</body>

</html>